added centos support + refactoring
added centos support + refactoring