Vladyslav Didyk

Clean up the code

Makes code easier to read with the same behaviour.

Claude 'slash codes': Coding / Tech

Refactor the code below so it is easier to read and change, with exactly the same behaviour. Use clear names, small functions that do one thing, and remove duplication and dead code. Keep the public interface unchanged. Show the new code, then list each change and why. Flag anything that looked like a bug but that you left alone.

Code:
[PASTE CODE]

Catalog