moving logging and some basic setup out of run(), and into preamble