old Scala 2.7.x utility code