Moving all JS code into their respective modules