Refactoring rest