cleaned up ugly msgInfoDecode function and other minor cleanups