progress on factoring out key unlocking