[Backend] Complete code refactor for DI pattern