refactored session and models of the example blog