Clean up unused imports and obsolete code