refactor & auto play