Refactored calculation feature works fine