Moved session parameter setting into helper method)