refactor form population - add populateForm utils function