refactor resource lib after fix bug