Refactored old code.