improved syncing and made optimizations