End of day, finished to implement the requested functionalities.
Need code cleaning and maybe some refactoring