More refactoring to make more readable