A little work and some PhpStorm refactoring magic