Refactoring and new prof of concept file for next re-writing.

Signed-off-by: Herve Tatche <herve.tatche@gmail.com>