Fix banzai replace button
Code refactoring.