fix packagename and optimize code