More refactoring, no functional changes