Refactoring: Change functions order