first big revamp
closed implementation. little js refactor to be planned