Hotfix/calc refactor

same as https://github.com/edx/edx-platform/pull/832