Fix for repetitive code, fixes #99
Merge pull request #101 from Yonaba/master

Fix for repetitive code, fixes #99