made conditionals single line where possible