[REF] base, ir_sequence: refactored some code