Refactor the code of the post processor to work properly.