more work, some templating logic in place