better javascript coding style