Tidied up interface code.