Refactored methods to be more readable