Moved the common ESC routines