refactored main webserver out into different files