remove redundancy with method for formatting a collection of posts