simplified data handling
removed unused imports
added field based validation