optimize code and fix small bugs