factoring, migration of html macros, library cleanup