Use scala options instead of null