Refactor the service list building