After selection algorithm refactoring