[enhancement] Issue #1 resolved: decoding part rewritten in Scala