Code tidy-up