Minor refactor of avatar key handler.