factorial clean up