move key mirror to util module