Simplified the decode method.