refactor with calculate -> operate, and memorize