Some refactoring
Merge branch 'master' into HEAD