refactor; fix pause