Remove unnecessary optional parameter
Add register count and credentials handling