better frame composing logic.