simplified app. added app factory