refactor reflection template for models