refactor registers

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Merge pull request #3647 from vieux/refactor_registers

refactor registers