Refactor

use fuc mothod refactor code other than oo