mu2duk: cleanups and refactoring