use ?: operator where possible