More code tidying