Refactor client login view to facilitate hooks