Add refresh button

Required a bit of a refactor to make it work properly