refactoring for CentOS support