Fix refresh button and refactor fetch envelopes logic. It can cache now too!