slight tidy up and auto reload