split to func