clean some code, add import support