Refactored Graphics class