reindent code and optimize import