Created a factory so that posts are accessible by other modules