Refactored old Code