Refactor Connection and Login Class