Refactor: No use of null in Scala