Improve scala syntax.