Implements performance optimisation. The best I can think of right now.

Refs #84