refactoring to remove a lot of boilerplate request code