Refactored host for tests