improvements in render state and frame buffer factory