Cleaned up a function.