Revert "optimisations to references etc"

This reverts commit 13f398c2bb4f19c7bb931a798d72a65d360adbfc.
reverted away from optimised refs