Refactor hosts

A refactor of the hosts class method.