Aidoc Interview Question

Refactor code to improve readability, simplify and enhance maintainability