Refactor Gravatar module to reduce assignments and method complexity