First stage of cleanup/improvement of FrameFinder algorithm.