move gfx functions to draw

See #12.