refactor(worker): check type by instance of