refactor into classes

overwrite of js folder to refactor into classes