Cleans up a bit of messy scripting in init.js