improve array filter a bit