moving helper functions from applicationController to sessionsHelper