refactored code into Language.Clafer.IG library