Fix class scope
Fix environement checking