More refactoring for readability