some refactoring in marking
Merge remote-tracking branch 'origin/master'