Refactoring checking for tmux