finishing authentication, added memoization in application controller