I have the following code and i need to refactor it to reduce complexity and increase modularity and encapsulation. I also need to reduce the ck metrics value.
pr