slightly refactors Endpoints.java