Protect logic by using subshells