improve grapic code.