fix: codebase improvement and memory related bug has been fixed.