Application of process analytical technology (PAT) tools for the better understanding and control of the crystallization of polymorphic and impure systems