more refactoring, figure out request mocking