Refactor for stability
Merge branch '1.x' into gh-pages