Remove lexical_cast responsibility, prepare to extract and separate the different part of the core algorithm.