Added code on generic refactoring