refactoring transactinController