a small refactor