refactored calculation variables