Added support for filtering toJSON output