Refactoring:
* validation functions