After thinking for a while, i came up with simplifying the whole thing, now the application only creates 1 file, the groups created by the user are located within that file also the contacts, so when the user wants to export only a group it will be easier to do, so i came up with this flow, for managing the groups, and the contacts within them.

Still if someone has tips, or comments on this please post