refactoring of statemap
work on statemap resolve references