various cleanups, comments; NOTE: broken at the moment