rewrite to server, mobile, setup_environments