refactoring GAC function