Code improvement

better performance