Added custom_data and where_extra support