Clean up code using httpobjects