Factory added to make app more loosely coupled