refactor with camila much better implenmantation