refactoring to prepare for array syncing