Trying to fix by refactoring.