Use enums for detecting instruction type in worker.