Big refactoring....
Sync with 8devices after updates on both sides