Improved JS method to take arguments.