Refactored application as of exercise E1;