Refactored to add Sequence class