Moving session initialize into its own method.