refactoring
fix transaction treatment