refactoring of service conroller