Code refactoring according to new format and generalized clustering approach.