Refactor some code behind displaying versions for each post