Refactor to not enteract with session from controller and view