removing some duplicate code
Merge pull request #298 from plockaby/remove-dup-method

removing some duplicate code