add validateSync and small improvements

Function Declaration does not contain at the end a semicolon because it is not the Function Expression