more optimizations
Merge pull request #3 from Nijikokun/master

Optimize various common methods