refactored graph setting out as their own classes and added model spec tests to cover them