Refactored validator, added much scaladocs