Cleaning up js a bit