Making sure to teardown in the same scope
Support environment prefixes
Making prefix removal work with deprecated API