tiny refactor: extract logging, sleeping