- small refactorings, making it more scalaish