why not keep the if on the same line?, I think it is idiomatic in scala