Appeal from a judgment of the County Court of Chemung County (Hayden, J.), rendered December 7, 2007, convicting defendant upon his plea of guilty of the crime of criminal possession of a controlled substance in the fifth degree.
Defendant was arrested after his vehicle was pulled over on a routine traffic stop. Upon his arrest, defendant allegedly made spontaneous statements to the police regarding the presence of drugs in his vehicle. Defendant was thereafter indicted for criminal possession of a controlled substance in the fifth degree. Following his arraignment, at which defendant was represented by the Public Defender’s office, defendant’s counsel served discovery demands on the People and moved for various forms *949of relief, including a Huntley hearing. At the next court appearance, it was noted that a plea offer had been made and the court granted defendant’s request for an adjournment to retain private counsel. At the next court appearance two weeks later, defendant—having apparently been unsuccessful in retaining counsel—requested another adjournment in order to do so, which the court again granted. When the- case was next scheduled two weeks later, defendant was still without private counsel; at his request, the Public Defender’s office was reassigned to represent him and the matter was adjourned for a Huntley hearing. In the meantime, the People had served responses to defendant’s requests for a bill of particulars, discovery and omnibus motion. When defendant appeared for the Huntley hearing, he waived his right to such hearing in exchange for certain Rosario material, and the matter was adjourned for trial.
On the morning the trial was to commence, defendant pleaded guilty to one count of criminal possession of a controlled substance in the fifth degree. He was later sentenced to one year of incarceration and one year of postrelease supervision. Defendant now appeals on the basis that he was denied a Mapp and/or Ingle hearing and that he received ineffective assistance of counsel. Because we find that defendant’s arguments are unpreserved and, in any event, are without merit, we affirm.
Defendant’s claims that he was denied a fair trial and that he did not receive the effective assistance of counsel are unpre-served for review due to his failure to move to withdraw his plea or vacate his judgment of conviction (see People v Johnson, 54 AD3d 1133, 1133-1134 [2008]; People v Parara, 46 AD3d 936, 937 [2007]) and, in any event, are without merit. Furthermore, insofar as defendant’s claims involve matters outside the record, they should be pursued via a CPL article 440 motion (see People v Cruz, 53 AD3d 986, 986 [2008]).
Upon pleading guilty, defendant waived his right to any pretrial hearings (see People v Socrates, 307 AD2d 546, 546 [2003]; People v White, 300 AD2d 830, 832 [2002], lv denied 99 NY2d 586 [2003]; People v Saxbury, 95 AD2d 871, 871 [1983]). We also note that, for counsel to be effective, he or she must provide meaningful representation (see People v Sorey, 55 AD3d 1063, 1064 [2008]; People v Johnson, 54 AD3d at 1134; People v White, 47 AD3d 1062, 1064 [2008], lv denied 10 NY3d 818 [2008]) as shown by an examination of the totality of the evidence, facts and law (see People v Baldi, 54 NY2d 137, 147 [1981]). Here, counsel attended court proceedings, filed pretrial motions to dismiss and to suppress, attempted to negotiate a plea agree*950ment, accompanied defendant to his presentence interview, filed a presentence memorandum and advocated for, and achieved, a favorable sentence. The negotiation of a plea deal despite the existence of a potential defense does not necessarily require a finding of ineffective assistance of counsel (see People v Johnson, 54 AD3d at 1134; People v Anderson, 38 AD3d 1061, 1063 [2007], lv denied 8 NY3d 981 [2007]; see generally People v Baldi, 54 NY2d at 146), and defendant has not shown a lack “of strategic or other legitimate explanations” for the decision to waive pretrial hearings (People v Caban, 5 NY3d 143, 152 [2005]). Thus, we cannot say that defendant was deprived of meaningful representation (see People v Johnson, 54 AD3d at 1134; People v Lawrence, 34 AD3d 984, 985 [2006]).
Peters, J.P., Rose, Lahtinen and Kavanagh, JJ., concur. Ordered that the judgment is affirmed.