added ref to env and resources further out