finished with the removal of some code duplications with a functionpointer dictionary