The present invention provides an improved process for preparing a compound of formula (IIIA), an intermediate of the synthesis of varenicline. Also, the present invention provides an improved process for preparing varenicline, or a pharmaceutically acceptable salt or solvate thereof. Furthermore, the present invention provides a process for decolorizing varenicline, or a salt or solvate thereof. Still further, the present invention provides a process of preparing varenicline L-tartrate with improved yield. Still further, the present invention relates to the use of compound of formula (V), or a salt or solvate thereof, as a reference marker and reference standard for assessing the purity of varenicline, or a salt or solvate thereof.