Refactoring functional