Tried to port a portion to Scala 2.10