refactoring the http -> engine classes into something a little more
testable