replace for with filter as and maps