Refactored towards supporting Redhat family OSes.