Major code refactor in preparation for config support
Major code refactor to prepare for config file support