Well, I received a review comment stating using if blocks for trades instead of when makes it more readable. While, I personally do not like using if blocks - I agree on the readability part. Hence, converted trade statements to purely if block based from when. Also have kept older when based syntax below in the commented section. Feel free to use whichever appeals more to you.