some changes to provide validation and tracing