simple rest refactoring