Refactored each method to iterate over links instead of content, added collect and clear methods