still cleaning up and moving all logging into json format