Moving hard-coded posts array to a factory