Add validations
Refactor to use function literal and closures