Revert "Refactor code"

This reverts commit 290aea59771d1ff661e1bb24b5c124f38a7dfe5f.
Refactor post truncate code