Significant refactor of module

Is the use of `%d` instead of `%u` here intentional?