Changed decoder to use anonymous classes