refactor play