improve declarative service generation