Code cleanup: Decoder.c

-) general code cleanup and code refactoring of whole file