fix gh-41 by removing duplication and cleaning up
Merge pull request #46 from ralovely/host_parser

fix gh-41 by removing duplication and cleaning up