minor review with some small refactor
Merge pull request #1 from ccancellieri/carlo

minor review with some small refactor