Refactor the code in preparation to the new change of the design.