Reorganized and added support for syncing