cleaning up js a bit