How to organise reusable functions - tRPC