Refactor filter utils to be immutable

Move subject scheme information processing to filter utils and return
a new instance instead of modifying the existing utils.