Tidied up the before blocks a little bit