Extracting snippet from page and adding it. Refactored some code.