Merge pull request #263 from renaudJennyRBS/sync

Fix #257 and fix #258 issues and some refactoring