Some code tidying.