Added support for before for Memory and Rest