Added Scala objects for refactoring.