Refactor parsing ads