update (not an inspired commit message..)
Add function to sync templates files and db.
finish the refactoring begun last commit