and even more refactorign