Refactoring and adjusting the code to the new approach.