refactored to show validation result (issue #3)