More code refactoring and added support for installation