improved variable declaration in js