Reworked structure, jQuery in js