Sequences: refactoring