merging the symbol lookup code
fix issue with creating fields
Removed duplication in symbol lookup (fix #372, fix #323, fix #343)