small re-organization to make the whole process clear