remove duplicate code
fixes #331, remove special chars
Merge pull request #339 from dubslow/master

Fix #331, remove duplicate code