code refactoring and eliptic defect