Performed the third code refactoring