Refactored validators. Closes #2.