refactor
adapt example