Replace Condition Branches by Methods