the logic for figuring out whether it is scala 2.10 or not is repeated many times over. Can that be factored out once and reused ?