sample: refactoring