Also given that we have 4 identical copies of the validate_for_algorithm function should it not be split out into a single method?