Fix ComplexMethod
debt and refactor code
#5029
Merged
ComplexMethod
debt and refactor code
#5029