Validation logic implementation. (first phase)