Clean up some code Scala style