Agree - those steps are a hazard!
I think that highest priority would be to create a simple function too smooth these.
Edit: It is one of those moments that my heart starts pounding like meeting my wife the first time!
1. Make this Get Position stuff for an A vector
2. Make a Dot-product of the A Vector with itself
3. Smile!
Works the same with the B-Vector