Refactoring: Smaller functions