Source code refactoring. Extracting common functionality in a few pair o...

Source code refactoring. Extracting common functionality in a few pair of methods in a couple of files , retaining semantic equality and reducing code size