Fix implicit conversion to string error
Move transaction creation logic to service