code tidy - sep functions