cleaned up redundant code