Refactor properties management

Hi, I propose you to have a look at this version that cleans a little bit the main code regarding to the way the properties are managed. 
Thank you.
Bernard