Cleanup and add reading JSON conf file to define