parser: move TA logic into its own package