Describe a situation where you had to refactor a significant portion of your codebase at Trupeer AI; what was the driver?