Refactor, using java.util.Functions