re-organized env module