some tidying up of code .. nothing major