Refracor of the import and update proccess

I changed the code to use a helper function for each entity.
both import and update now use the tools library.

[fixes #25 #26]