split to functions