Cleanup and small refactor

Removed the requirement on the 'env' package and other cleanup