Started modularilzing the graphics code