Separating common environment related functions
Tidyng up exposed interface