refactored control flow for more fine grained process control, improved unit test scafolding, detachable logger