Simplify restoring functions
Improve notation