Optimize imports and resolve warnings from IDEA