small Endpoint refactoring