Refactor sync-console