Extract code from a partial
Fix: identation
Add session to pase