Some refactoring was done.