move functions to app