Refactor the form extractor to allow extraction from FormListeners