Detect staging project only when review by_project is in new state

And remove duplicated code.