re-factor esc