From https://github.com/micc83/ReStable