some refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
more refactoring and some fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>