[WIP] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
and how do you do the error message? yeah I could put the unique in the top line.