loads of refactor fixes to try to get retrieveal of spikes working correctly