full modeller refactoring is done and seems to work. Debug messages are added