Refactored via decompose conditional pattern