separated some functions