code cleaning and added new post-processing method