Recoding Hedzup for improved performance and code legibility.