1) make code more interface oriented
2) make the logic more clear and reduce potential duplicated computation