Code tidy up for readability