Rest refactoring