Make opts more flexible in test helper
Introduce TransferHandler to reduce code duplicity