corrected re-factoring