better implementation for asynchronous filter