More refactoring for better readability