add missing imports and cleanup