Fixes; added dependencies; switched to templating