improved validation
cleaned up test template