Code tidying