Refactoring to work with new webserver funcitionality