Optimize to be much faster (10 times factor)