removed redundant code from 2nd method