better reorgniazation fo code
fetch data when uswer is logged in