added logic and  test for adding and removing properties from template