code refactorign