Tidied from old repo