Refactor rule processing
Use an explicit compose function for array fusion