Minor refactoring in play and play_tests