Rearranging filter method so it can be used on the index