Remove unused function and cleanup.