Added Test Cases/ Refractoring