refactor common code to cocos2dx-common