some code refactoring
Merge commit