refactor
implement resume