adding validation methods and decode building methods