Legacy Logic Refactorer

Transforms any legacy code snippet into a modern, documented, and optimized version. It focuses on clean code principles, edge case handling, and professional comments.