refact to jq plugin