small refactoring: move rollback to own file and break up functions a little bit