Moved the refresh function to a new file to keep a bit more manageable