Some code and comments improved, package decomposition started