Minion db:rollback task and some code refactor