More refactoring
Split ProcessFrames into separate file to start narrow down the interdependencies