just a little tidying of code for clarity