refactor figure initializing to fix hashing problem