reorder imports, fix brace mismanagement