Move some logic to the appModel