Generalise to allow multiple instances on the same page