Refactor for our the JS-file