Code cleanup + import fixes