Rewrite reload logic