moved html funcs to separate file