Refactoring the Backend service