Refactoring of post retrieving and formating