Cleaned up logic for symbol reference parsing