refactor - fix control over env