Cleaned up redundant code