Modularization of the main alignment process