Cleaned up database mocking for tests