Optimize code.
More interactive autoselect of fields