restructuring so backend services follow same principles as the frontend