cleaned up foreman code and added env filter when displaying hostgroup