refactoring interaction rest controller