Describe a time when you had to work with a legacy codebase. How did you approach understanding and modernizing it?