Re-factory Code