add validateSync and small improvements

Function header comment