Move the graphics lib stuff to the library