- added rollback support (fate#317062)
- moved function to separate file
- coding style