Cleanup code of `prelude-cleanup-buffer`

See the detailed commit message.