[WIP] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
In the docstring, yes, but I must say that I find the name quite clear.