Move validator to separate file.