refine output and data types.