Fix env detection path
Prepping for test refactoring
Refactoring tests