Refactor Graphics

Refactor the Graphics class.