move back the function
moved to services
moved authenticate to app service