more work on dynamic template