Refactored old code