NOREF: Adding logic for keyfile