refactoring of layer calculators