minor performance improvements with caching
Merge pull request #17 from rolyatmax/master

Minor performance improvements