Refactor useage of on to prevent flooding events