Simplify reuse code, rename variables.
Merge branch 'master' into gh-pages