This might be able to be refactored to use predicates.