refactoring for GA implementation