better decoder abstraction