More preparation work for variable frame size