Code refactoring : removed redundancy