[WIP] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
why? I could also put it at the very end, but that wouldn't really make a difference.