refactor of api key files