Add reg::type data member.
Remove unused var.
Rename functions and update some of the interface.