made extract key its own function inside of build key