Refactor needed in online_calularor