Resync'ed code from main branch