refactoring bimpl + envset