Replace some fancy stuff with simple function

This makes it consistent with the decoder test app.