Tidying helper functions.