refactored and removed redundant code