Added refactoring of method.