Reorganizing code into partials and external controllers