Compact syntax of validate functions. Remove unnessary string encode()