Cleaned up the module, added exception print messages only if debugging is enabled from the conf