introduce back functionality and split up some JS