Update instance_methods.rb

perfomance optimization
perfomance optimization bugfix
Merge pull request #376 from ASnow/master

Refactoring for perfomance optimization