Added public method to get environment