Refactor the aka_host checking lines into a helper method