Breaking functionality appart
Breaking functionality appart

Moving operations to their own functions and using the Session to pass
variables around.

scimusmn/sd-scrapbook,scimusmn/sd-scrapbook,scimusmn/sd-scrapbook