refactoring login/register box
refactoring login/register