For refactoring, p.s. synced wait and notify