Move performance-intensive calculation of applyFilter in separate method to avoid bail-out of V8-compiler due to try/catch-block.