Merge refresh control code together