Cleaned up reduntant code