change decoder switch and if else to hash map code detect