Tidied up some unnecessary code