refactor figure[]