refactoring extension fix logic