Refactoring of existing code