Clean code

First iterations to clean-up the source code, in relation with issue #4.