Better working unique validator wihout weird internal function callback, formatting cleanup.