added periodic refresh and expanded margins