Cleaned up _getRawKeyPoints function

_getRawKeypoints function was too cluttered. I have tried to clean it up a bit.