many improvements, most of them are from scala 2.10