refactor StackMap. Singleton now.