Some code cleanup; better feedback on register