This commit is doing a general refactoring of the current code base and it also integrates the new plugin lib.