refactored post-processing