Clean up server main and move config