Fixed some compile error
Refactoring and cleanup of imports