Normalized graphics drawing code to avoid repetition using a common graphics primitive factory class.