Refactoring of the code.