extracted graph related parts and individual node related parts into their own classes