continued refinement and cleanup