more refactoring of html dependency functions