Code cleanup: removed unused function and imports