pause player feature and minor refactoring