These ternaries ?:s should be replaced with plain if/else blocks (better keep things explicit and readable)