Enhanced filtering API for #77 and #78