Refactor the options handling in the environment

Clean up some unused properties too