Refactor Reddit API lib