Refactor Endpoints.