cleaning a bit of javascript 2