Improve script.js making it a bit more OOP