Tidied up the type declarations