modified veil_env and refactor #26