refactoring based on twitter and tumblr setup