internformula refactor