Use which instead of variable declaration

Variable declarations are wrong way to check is something installed. `which` works in the all cases.