Improved formatting of html, bound callback functions instead of passing objects