fixed some bugs, moved from hackish properties in HTML elements' classes to data-attributes