Refactor transfer to create or update transfer item on the fly

Use a ternary operator here instead of if/else