Refactoring out hostname to a variable