Bit of tidying up and messing about with Ajax