Removed unused definitions and getenv call
Changed way to setup environment