refactor with commander