better type filtering