Add some handy functions, and remove an unused one