Refactored code and added support for SUSE.