pre-run-master logic