cleanup, redesign, bugfixing