refactor to correct js style on parameters