Optimize record look-ups

Closes #11.