Tidying up functions.