Simplify code, need to fix getSessions event listener.