refactored transactions controller