Fix: Remove repeated code
Merge pull request #586 from fuhu/master

Fix: Remove repeated code