use Graphics::DataType instead to remove redundant code