Moved http helper code into separate files