[IMP] analyze: some code refactoring