Cleaning up functions.