Refactor everything to use sessions