Move code into private function so more DRY
clean up code in default.php
Merge remote-tracking branch 'origin/development'