Refactor logic to setup notes session