add version, clean-up a bit the code