further refactorign