General Cleanup. Remove duplicated logging code. Remove dirty testing code.