Updated to fix Line contains trailing whitespace and ABC complexity violations