Refactoring GEC curve calculation