Moved validations to named functions

Reduced surface area of the module's API.