refactoring done, all test passed.
//TODO new functionalities, test & refactoring obsolete code.