Added docs and specs for host_environment and refactored accordingly