refine js method calls