rework calc + refactoring