Improved trim, readEnvs