Fix for repetitive code, fixes #99

Just a quick fix for issue #99 ?
Let me know how it works for you.

Regards,
Roland.