significant refactors to assign keys interface code