Refactor implementation and used better accessor for Endpoint configuration
Conform to SS codebase's formatting