refactoring run/attach/logs