Pulled key mapping out of function.