M: some changes + refactoring.