A compositional approach to structuring and refinement of typed graph grammars