Better performance
#79 fix and #72 partially fix