Refactored the endpoint configuration logic