Move common code from launcher and logger to the `device` module