A little refactoring.  Use Scala collections