Updated toCC

Updated toCC with Scala reflexion instead of the Java