Moved authentication framework into a separate module