Updated validate method to support closures
Added additional logging for closures