Refactor env collector