refactor complete registration