Refactor play module