Cleaned up duplicate functions.