Some refactoring of code, made one lib to be included for all modules, later it should be broken up.