Refactored for easy access to endpoints