improve code segregation, implement Rerun