Split calculate method into two methods