move cla parsing to a function