Removed session expiration. Refactored a bit of code.