Some refactorings were done.