added filtering and ref/mut