Refactor --project and --environment options.