small refactor for better understanding