refactored everything and added support for a hostmap JSON file