refactoring inbound endpoint