Code refactoring and customization