Try another attempt for reading framebuffer to memory and code cleanup