refactor config and made server setup script separate