REFACTOR EXTISTING CODEREFACTOR EXTISTING CODE