Webserver rearranged according to stepdown rule, functions extracted from submithandler