change if/else to ternary operator, see #14