WIP - Refactor every JS file