Code Re-factor