refactoring a giphy service