extracted backend mocking code to a separate file