clean up request mixin code to avoid lots of code duplication.