refactoring of goto-daemon