tidying of code