refactor api keys