code refactoring, introduction of sequence manager