refactoring
Merge branch 'master' into gh-pages
Major refactoring stage 2