Refactor the 'fmt ' tag search and parsing