add factory method, update to scala 2.10