Moved some frame creation code into a factory