Updated to use enum names rather than artificial codes.