[WIP] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
Is there a point of making a function for this?