2 improvements

1. Add lambda function as parameter to filter
2. Batch insert