[MRG] Input validation refactoring

Refactor input validation to make it more consistent.

Todo
* [ ] Tests
* [x] docstrings
Can you make a blank line between each case to ease reading?