Factored out symbol extraction code