Refactoring code for LEAK BLOCK feature