sequence iterators now can return values

also made some minor refactorings