refactored Session.js, now providing render function