refactor
templating with variables now works