Receipt optimisation

@FWKamil could you review and merge if you are happy please?

(think its useful to review each other's code)