Added a template implementation, and moved lookup path thing to a separate module