Introduce Strategy class for handling the different algorithms
 Cleanup code