Re-re-factored solution