frame_factory.h replacement_algorithm.cpp replacement_algorithm.h