Endpoint refactoring