WIP: refactor a bit PR#18