minor review with some small refactor