Refactored DAO classes and updated LoginManager logic.