Bit of code tidying up