Tidied up the framework