Extract js method