updated app.factory