Retooled some functions.