improve explorer: use ternary operators