optimizing extracting data for forms