The current function uses separate return statements for error and success paths. While functional, this pattern can make the logic harder to follow and maintain, especially as the function grows. Refactoring to use a single return improves readability, simplifies testing, and makes future changes easier to manage.