This is a PHP design pattern solution.