In some parts of the code, Euler angles are used (good interpretation), while in others, quaternions (easy calculation) are used.
For a better code quality, it would make sense to use a single representation throughout the whole code.
I think one good way to achieve this, would be to introduce something like a "rotation" class which uses quaternions internally but exposes (i.e. converts to) common (Euler Angles, Rotation Matrix, quaternion) representations.