Session: move more code to .cpp