Merge "Cleanup and refactoring of an earlier cl."