Refactoring of service generation