reflow event code for easier reading in web ui