Cleanup of `transaction.construct()`

- Clearer logic
- PEP 8