Refactored parser code to fix mislabeling of hostmask