Initial refactoring moving IDM related classes from eventjuggler