js: make method parameters objects