Refactored code, added User Session