Reindent with tab width of 2.
Refactor register function slightly.