Refactor server main fn, tidy boot ns