cat and ls code improvements