add gravatar support, little refactoring