Moved posts to a factory and injected it into MainCtrl