refactor & SimpleDecoder overhaul
externalized decoder and changed api for flexibility