genetic core refactored