bux fix
Code refactoring for performance enhancement