Refactor for readability. Wrap custom level task in transaction.